<template>
<div>
    <h1>收费申诉</h1>
  <el-table
    :data="tableData"
    border
    style="width: 100%">
    <el-table-column
      fixed
      prop="rID"
      label="记录id">
    </el-table-column>
    <el-table-column
      prop="aEnd"
      label="打卡时间-终点">
    </el-table-column>
    <el-table-column
      prop="aProof"
      label="收费证据信息">
    </el-table-column>
    <el-table-column
      prop="aProvince"
      label="收费省份">
    </el-table-column>
    <el-table-column
      prop="aStart"
      label="打卡时间-起点">
    </el-table-column>
    <el-table-column
      prop="amount"
      label="金额">
    </el-table-column>
    <el-table-column
      prop="cId"
      label="车辆id">
    </el-table-column>
    <el-table-column
      prop="dpNum"
      label="车型">
    </el-table-column>
    <el-table-column
      prop="pEnd"
      label="目的地">
    </el-table-column>
    <el-table-column
      prop="pStart"
      label="出发地">
    </el-table-column>
    <el-table-column
      prop="status"
      label="状态">
    </el-table-column>
    <el-table-column
      prop="time"
      label="时间">
    </el-table-column>
  </el-table>
  <h3>申诉理由</h3>
  <el-input
    type="textarea"
    :autosize="{ minRows: 10, maxRows: 10}"
    placeholder="请输入申诉理由"
    v-model="textarea2">
  </el-input>
  <el-button @click="submitAppeal" style="border-radius: 15px;width: 150px;margin-top: 30px;float: right" type="primary">提交</el-button>
  </div>
</template>

<script>
  import axios from 'axios'
  import cookies from 'js-cookie'
  export default {
    data() {
      return {
        tableData: [],
        textarea2:''
      }
    },
    mounted() {
      this.tableData[0]=this.$route.query
      console.log(this.tableData)
    },
    methods: {
      async submitAppeal(){
        let mydata={
          oId:cookies.get('id'),
          rID:this.tableData[0].rID,
          reason:this.textarea2,
        }
        axios.post('/owner-inspector-apeal/add',mydata).then((res)=>{
          console.log(res)
          if(res.data.code==='0'){
            this.$message({
              message: '申诉成功',
              type: 'success'
            });
            this.$router.push({path:'/VVHistory'})
          }
        })
      }
    }
  }

</script>
